using System.Collections;
using System.Web.UI.WebControls;

namespace nToolbox.Web.Controls
{
    public class RepeaterBinder 
    {
        private readonly IEnumerable _DataSource;
        private readonly Repeater _Repeater;

        internal RepeaterBinder(Repeater repeater, IEnumerable dataSource)
        {
            _DataSource = dataSource;
            _Repeater = repeater;
        }

        public void Do()
        {
            _Repeater.DataSource = _DataSource;
            _Repeater.DataBind();
        }
    }
}